<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>鼠标进入，图片移动</title>
    <Style>
        .bar{
            background-color: black;
            margin: 0 50%;
            padding: 0;
            width: 100px;
            height: 100px;
        }
    </Style>
</head>

<body>
    <div class="bar">

    </div>
    <script>
        const bar=document.querySelector('.bar')
        bar.addEventListener('mouseenter',()=>{
            console.log(11111111);
        })
    </script>
</body>

</html>